import java.io.File;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2024-08-25
 * Time: 13:27
 */
public class Demo2 {
    public static void main(String[] args) {
        File sourFile = new File("./abc");
        File destFile = new File("./cba");
        boolean tf = sourFile.renameTo(destFile);
        //进行文件名改名
        System.out.println(tf);

        File sourFile1 = new File("./qwe/rty");
        File destFile1 = new File("./rty");
        boolean tf1 = sourFile1.renameTo(destFile1);
        //也可以进行文件的路径的修改
        System.out.println(tf1);

    }
}
